package com.tancire.quartz.task;

import com.tancire.member.service.IMemberTrainChartService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 刷新排行榜数据
 *
 * @author chenchao
 */
@Slf4j
@Component("memberTopTask")
public class MemberTopTask {

    @Resource
    private IMemberTrainChartService memberTrainChartService;

    /**
     * 统计流量并清空日志
     */
    public void refresh() {
        try {
            this.memberTrainChartService.refreshChart();
        } catch (Exception e) {
            log.error("执行刷新排行榜定时任务失败：{}", e.getMessage());
        }
    }

}
